package com.weigang.mybatis.controller;

import com.weigang.mybatis.entity.HrUser;
import com.weigang.mybatis.mapper1.HrUserMapper1;
import com.weigang.mybatis.mapper2.HrUserMapper2;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/user")
public class HrUserController
{
    @Resource
    private HrUserMapper1 hrUserMapper1;
    @Resource
    private HrUserMapper2 hrUserMapper2;

    @GetMapping(value = "/getUsers")
    public String getUsers(){
        List<HrUser> user1 = hrUserMapper1.selectAllUser();
        List<HrUser> user2 = hrUserMapper2.selectAllUser();
        System.out.println("user1-->" + user1);
        System.out.println("user2-->" + user2);
        return "1111111111";//http://localhost:8080/user/getUsers
    }
}
